<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
   <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <script src="./data.js"></script>
  <style>
    .masonry{
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      padding: 10px;
    }
    .item{
      border: 1px solid #999;
      margin-bottom: 10px;
       break-inside: avoid; 
    }
    .img{
      width:100%;
    }

    span{
      display: block;
      margin-left: 5px;
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="masonry">
      <div class="item" v-for="item in listData">
        <img :src="item.img" alt="">
        <span>{{item.value}}</span>
      </div>
    </div>
  </div>

  <script>
    const { createApp, ref } = Vue
  
    createApp({
      setup() {
        const listData = ref(data)

        return {
          listData
        }
      }
    }).mount('#app')
  </script>
</body>
</html>